<script setup lang="ts">
import _ from 'lodash'

const emit = defineEmits(['click'])

const props = defineProps({
  type: {
    type: String,
    default: () => '1'
  },
  selected: {
    type: Boolean,
    default: () => false
  },
  content: {
    type: String,
    default: () => '按钮按钮'
  }
})

const handleAction = _.throttle(() => {
  emit('click')
}, 1000)
</script>

<template>
  <div :class="`type${props.type} ${props.selected ? 'selected' : ''}`" @click="handleAction">{{ props.content }}</div>
</template>

<style lang="scss" scoped></style>
